package com.bgs.controller;


import com.bgs.common.R;
import com.bgs.pojo.Products;
import com.bgs.pojo.vo.ZeroToReportAndOrderDetail;
import com.bgs.service.ProductsService;
import com.bgs.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 品类 前端控制器
 * </p>
 *
 * @author Asia
 * @since 2021-09-14
 */
@RestController
@RequestMapping("/bgs/products")
public class ProductsController {

    @Autowired
    private ProductsService productsService;
    //查询所有种类
    @GetMapping("zeroGetProducts")
    public R zeroGetProducts(){
        return productsService.zeroGetProducts();
    }

    //查询所有种类(3级联动)
    @GetMapping("/fourKindList")
    public R fourKindList(){
        return productsService.fourKindList();
    }

    //添加商品种类
    @PostMapping("/fourAddKind")
    public R fourAddKind(@RequestBody Products products){return productsService.fourAddKind(products);}

    /**
     * 删除某个节点(品类管理)
     * @return
     */
    @PostMapping("/fourdelKind")
    public R fourdelKind(@RequestBody Products products){return productsService.fourdelKind(products);}
}

